package com.browsesoft.tools;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class RequestHelper
{
  public static Cookie getCookie(HttpServletRequest request, String name) {
    Cookie[] cookies = request.getCookies();
    for(int i = 0; i < cookies.length; i++) {
      Cookie cookie = cookies[i];
      //System.out.println("cookie"+cookie.getName()+"   "+cookie.getValue().toLowerCase());
      if(cookie.getName().equals(name)) {
        return cookie;
      }
    }
    return null;
  }
}
